# Copyright 2022 Ant Group Co., Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

load("//bazel:yacl.bzl", "AES_COPT_FLAGS", "yacl_cc_binary", "yacl_cc_library", "yacl_cc_test")

package(default_visibility = ["//visibility:public"])

yacl_cc_library(
    name = "kernel",
    srcs = ["kernel.h"],
    deps = [
        "//yacl/link:context",
    ],
)

yacl_cc_library(
    name = "svole_kernel",
    srcs = [
        "svole_kernel.cc",
    ],
    hdrs = ["svole_kernel.h"],
    deps = [
        ":kernel",
        "//yacl/kernel/algorithms:silent_vole",
    ],
)

yacl_cc_binary(
    name = "svole_kernel_bench",
    srcs = ["svole_kernel_bench.cc"],
    deps = [
        ":svole_kernel",
        "//yacl/link:test_util",
        "@com_github_google_benchmark//:benchmark",
    ],
)

yacl_cc_test(
    name = "svole_kernel_test",
    srcs = ["svole_kernel_test.cc"],
    copts = AES_COPT_FLAGS,
    deps = [
        ":svole_kernel",
        "//yacl/link:test_util",
    ],
)

yacl_cc_library(
    name = "ot_kernel",
    srcs = [
        "ot_kernel.cc",
    ],
    hdrs = ["ot_kernel.h"],
    deps = [
        ":kernel",
        "//yacl/kernel/algorithms:ferret_ote",
        "//yacl/kernel/algorithms:softspoken_ote",
    ],
)

yacl_cc_test(
    name = "ot_kernel_test",
    srcs = ["ot_kernel_test.cc"],
    copts = AES_COPT_FLAGS,
    deps = [
        ":ot_kernel",
        "//yacl/link:test_util",
    ],
)

yacl_cc_binary(
    name = "ot_kernel_bench",
    srcs = ["ot_kernel_bench.cc"],
    deps = [
        ":ot_kernel",
        "//yacl/link:test_util",
        "@com_github_google_benchmark//:benchmark",
    ],
)
